<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output indent="no" method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
	<xsl:decimal-format decimal-separator="." grouping-separator=" "/>
	<xsl:template match="/root">
		<html>
			<head>
				<title>
					<xsl:value-of select="subject_base"/>
				</title>
				<style type="text/css">
					body {padding: 0; margin: 0;}
					#main {padding: 1em; margin: 0;}
					h1 {padding: 0 0 .4em; margin: 0; font-size: 1.2em;}
					.document_table {width 100%;}
					.document_table td {padding: .2em 1em .2em 0; vertical-align: top;}
					.field_title {font-weight: bold; white-space: nowrap;}
					.field_value {}
				</style>
			</head>
			<body>
				<div id="main">
					<h1>
						<xsl:value-of select="subject_base"/>
					</h1>
					<table cellspacing="0" class="document_table">
						<xsl:for-each select="document/field">
							<tr>
								<td class="field_title">
									<xsl:value-of select="@title"/>
								</td>
								<td class="field_value">
									<xsl:choose>
										<xsl:when test="@name = 'email'">
											<a href="mailto:{.}">
												<xsl:value-of select="."/>
											</a>
										</xsl:when>
										<xsl:when test="@type = 'text'">
											<xsl:value-of select="." disable-output-escaping="yes"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="."/>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
						</xsl:for-each>
					</table>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
